package homework;

import java.util.Scanner;

/**
 * 玩家出拳
 */
public class Player extends Role{
    Scanner scanner = new Scanner(System.in);
    public Player(){}
    public Player(String name){
        this.setName(name);
    }

    public int guess(){
        while (true){
            System.out.println("请出拳：1.剪刀 2.石头 3.布");
            int num = scanner.nextInt();
            if (num <= 3 && num >= 1){
                return num;
            }else {
                System.out.println("输入有误，请输入数字1-3之间的整数");
            }
        }
    }
}
